<template>
  <div>
    <h1>为事件处理函数标注类型</h1>
    <input type="text" @change="handleChange($event)">
    <!-- <div></div> -->
  </div>
</template>

<script setup lang="ts">
/**
 * input框 change事件
 * e.target.value 获取 input的值
 */
const handleChange = (e: Event) => {
  if (e.target) {
    console.log('change', (e.target as HTMLInputElement).value);
    // (e.target as HTMLInputElement)
  }
}
</script>

<style scoped>

</style>
